﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Student2024.UI.form
{
    /// <summary>
    /// 编辑登录界面代码
    /// </summary>
    public partial class FormLogin : Form
    {
        public FormLogin()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 编写btnOk_Click事件，代码如下
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            //条件判断，输入正确可以登录，否则弹出“用户名或密码错误”
            if (this.textBoxName.Text == "李嘉乐" && this.textBoxCode.Text == "ljl123")
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("用户名或密码错误");
            }
        }

        /// <summary>
        /// 编写btnCancel_Click事件，代码如下
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancel_Click(object sender, EventArgs e)
        {
            //用户点击Cancel，直接关闭窗体
            this.DialogResult= DialogResult.Cancel;
            this.Close();
        }
    }
}
